<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
      <div v-if="crud.props.searchToggle">
        <el-form size="small" label-width="70px" v-formkey="{query:crud.toQuery}">
          <el-row :gutter="10">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="业务日期">
                <div class="flex flex-row">
                  <el-date-picker
                    v-model="query.startTime"
                    align="right"
                    unlink-panels
                    class="fl1"
                    format="yyyy - MM - dd "
                    value-format="yyyy-MM-dd"
                    default-value
                    range-separator=""
                    placeholder="开始日期"
                  />
                  <el-date-picker
                    v-model="query.endTime"
                    align="right"
                    unlink-panels
                    class="fl1"
                    format="yyyy - MM - dd "
                    value-format="yyyy-MM-dd"
                    default-value
                    range-separator=""
                    placeholder="结束日期"
                  />
                </div>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="单据编号">
                <el-input     style="width: 100%" v-model="query.code"></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="销售单号">
                <el-input     style="width: 100%" v-model="query.salesOrderCode"></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="车辆">
                <zSelect     style="width: 100%" :value.sync="query.carId" url="api/dropDown/basCarList" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
                <el-form-item label="司机">
                  <zSelect     style="width: 100%" :value.sync="query.driverUserId" url="api/dropDown/sysUserList"  :params="{businessAttr:'5'}" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
                <el-form-item label="跟车">
                  <zSelect     style="width: 100%" :value.sync="query.followUserIds" :multiple="multiple" url="api/dropDown/sysUserList"  :params="{businessAttr:'6'}" />
                </el-form-item>
              </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="客户">
                <zSelect :value.sync="query.customerId" :label="query.customerName" url="api/dropDown/basCustomerList" :params="{businessAttr:'3'}" style="width:  100%" />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="状态">
                <el-select
                  v-model="query.orderStatus"
                  class="filter-item"
                  clearable
                  placeholder="状态"
                  size="small"
                  style="width: 100%"
                  @change="crud.toQuery"
                >
                  <el-option
                    v-for="item in dict.common_order_status"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10" style="text-align: center">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="打印状态">
                <el-select
                  v-model="query.isPrint"
                  class="filter-item"
                  clearable
                  placeholder="打印状态"
                  size="small"
                  style="width: 100%"
                  @change="crud.toQuery"
                >
                  <el-option
                    v-for="item in dict.common_yes_or_no"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="是否验收">
                <el-select
                  v-model="query.isAccept"
                  class="filter-item"
                  clearable
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                  @change="crud.toQuery"
                >
                  <el-option
                    v-for="item in dict.common_yes_or_no"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="商品">
                <table-select
                  :tableColumns="[{prop:'goodsCode',label:'商品编码',width:'100'},{prop:'goodsName',label:'商品名称',width: '280'}]"
                  labelKey="goodsName"
                  valueKey="goodsId"
                  :value.sync="query.goodsIds"
                  placeholder="请选择商品"
                  url="/api/dropDown/basGoodsListForAdd"
                ></table-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="是否回箱">
                <el-select
                  v-model="query.isReturnBox"
                  class="filter-item"
                  clearable
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                  @change="crud.toQuery"
                >
                  <el-option
                    v-for="item in dict.common_yes_or_no"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="是否回箱审核" label-width="100px">
                <el-select
                  v-model="query.isReturnBoxPass"
                  class="filter-item"
                  clearable
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                  @change="crud.toQuery"
                >
                  <el-option
                    v-for="item in dict.common_yes_or_no"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="部门">
                <v-tree-select
                  v-model="query.deptIds"
                  url="api/dropDown/sysDeptTree"
                  multiple
                  value-consists-of="ALL_WITH_INDETERMINATE"
                  style="width: 100%;"
                />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="仓库">
                <zSelect :value.sync="query.warehouseIds" :multiple="multiple"  url="api/dropDown/basWarehouseList"  style="width:  100%"/>
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <rrOperation :crud="crud"/>
            </el-col>
          </el-row>

          <el-row>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="欠款状态" label-width="100px">
                <el-select
                  v-model="query.debtStatus"
                  class="filter-item"
                  clearable
                  placeholder="请选择"
                  size="small"
                  style="width: 100%"
                  @change="crud.toQuery"
                >
                  <el-option
                    v-for="item in dict.t_logistics_load_customer_debt_status"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="6" :lg="6" :xl="6">
              <el-form-item label="二批">
                <table-select
                  :tableColumns="[{prop:'code',label:'二批编码',width:'100'},{prop:'name',label:'二批名称',width: '280'}]"
                  :value.sync="query.sCustomerIds"
                  placeholder="请选择所属二批"
                  url="/api/dropDown/basCustomerList"
                  :params="{type:3}"
                ></table-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <crudOperation :permission="permission">
        <el-button
          slot="left"
          class="filter-item"
          size="mini"
          type="primary"
          @click="crud.toDetail('logisticsLoadAdd')"
          v-permission="permission.add"
        >
          新增
        </el-button>
        <el-button
          slot="right"
          class="filter-item"
          size="mini"
          type="primary"
          @click=""
          v-permission="permission.follow"
        >跟踪
        </el-button>
      </crudOperation>
      <el-dialog
        title="请选择打印模板"
        :visible.sync="crud.printConfig.pringDialog"
        width="30%"
      >
        <jPrintConfig groupId="logisticsLoad"
                      v-if="crud.printConfig.pringDialog"
                      @getPrintId="crud.toPrint"
                      :isPreview="crud.printConfig.isPreview"
        ></jPrintConfig>
      </el-dialog>

      <el-dialog title="表格配置"
                 :visible.sync="tableConfigShow"
                 width="60%">
        <j-table-column-config :columns.sync="crud.header" @tabSave="tabSave" @pit="pit" />
      </el-dialog>
      <!--表格渲染-->
      <el-table
        @contextmenu.native="showMenu"
        v-if="isShowTable"
                @header-dragend="changeColWidth"
                ref="table"  border
                show-summary
                @cell-dblclick="row=>crud.toEdit(row)"
                v-loading="crud.loading"
                :data="crud.data"
                size="small"
                style="width: 100%;"
                height="700"
                :summary-method="crud.sumRow"
                @row-click="crud.selectRow"
                :row-style="crud.rowClass"
                :row-class-name="crud.tableRowClassName"
                @selection-change="crud.selectionChangeHandler"
                @row-dblclick="row=>setQuery(row.id)">
        <el-table-column class="ss" type="selection" width="60" />
        <el-table-column type="index" width="60" label="序号"/>
        <el-table-column
          v-if="item.visible"
          v-for="(item, index) in crud.header"
          :key="`col_${index}`"
          :prop="item.prop"
          :label="columnLabel(item)"
          :width="item.width + 'px'"
          :data-porp='item.prop'
        >
          <!-- 自定义渲染模版 -->
          <template slot-scope="scope">
            <!-- 当列key为 sort 时，渲染一个手柄icon -->
            <template v-if="item.prop =='sort'">
              <div class="handle_move">
                <i :class="scope.row['sort']" />
              </div>
            </template>
            <template v-else>
              <span v-if="item.type == 1" style="margin-left: 10px">{{scope.row[`${item.prop}`]}}</span>
              <span v-else-if="item.type == 2" style="margin-left: 10px">{{ parseTime(scope.row[`${item.prop}`])}}</span>
              <span v-else-if="item.type == 3" style="margin-left: 10px">{{ getDict(`this.dict.label.${item.dictionary}["${scope.row[item.prop]}"]`)}}</span>
              <span v-else-if="item.type == 4" style="margin-left: 10px">
                  <span v-if="item.prop === 'isReturnBox'">
                    <span v-if="scope.row['isReturnBox'] == 1" style="color: red">已回箱</span>
                    <span v-else>未回箱</span>
                  </span>
                  <span v-else-if="item.prop === 'isReturnBoxPass'">
                    <span v-if="scope.row['isReturnBoxPass'] == 1" style="color: red">已回箱审核</span>
                    <span v-else>未回箱审核</span>
                  </span>
              </span>
            </template>
          </template>
        </el-table-column>
<!--        <div >-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('code')" prop="code" label="单据编号" />-->
<!--          <el-table-column :render-header="crud.render+Header" v-if="columns.visible('busDate')" prop="busDate" label="业务日期">-->
<!--            <template slot-scope="scope">-->
<!--              <span>{{ parseTime(scope.row.busDate) }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('carName')" prop="carName" label="车辆" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('driverUserName')" prop="driverUserName" label="司机" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('followUserName')" prop="followUserName" label="跟车" />-->

<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('boxCount')" prop="boxCount" label="箱数" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('orderNum')" prop="orderNum" label="单据条数" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('customerNum')" prop="customerNum" label="客户条数" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsNum')" prop="goodsNum" label="商品条数" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('receiveAmount')" prop="receiveAmount" label="送货家数" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('receiptAmount')" prop="receiptAmount" label="收款总和" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('returnBoxBoxCount')" prop="returnBoxBoxCount" label="回箱箱数" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('returnBoxTaxAmount')" prop="returnBoxTaxAmount" label="回箱金额" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('acceptDate')" prop="acceptDate" label="验收日期">-->
<!--            <template slot-scope="scope">-->
<!--              <span>{{ parseTime(scope.row.acceptDate) }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->

<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('acceptUserName')" prop="acceptUserName" label="验收人" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('returnBoxDate')" prop="returnBoxDate" label="回箱日期">-->
<!--            <template slot-scope="scope">-->
<!--              <span>{{ parseTime(scope.row.returnBoxDate) }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('returnBoxUserName')" prop="returnBoxUserName" label="回箱人" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('orderStatus')" prop="orderStatus" label="状态" >-->
<!--            <template slot-scope="scope">-->
<!--              <el-tag>{{ dictName(dict.common_order_status,scope.row.orderStatus)  }}</el-tag>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('isPrint')" prop="isPrint" label="是否打印" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('printCount')" prop="printCount" label="打印次数" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('remark')" prop="remark" label="备注" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('orderRemark')" prop="orderRemark" label="单据说明" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('weight')" prop="weight" label="装车重量" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('volume')" prop="volume" label="装车体积" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('createUserName')" prop="createUserName" label="添加人" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('createTime')" prop="createTime" label="添加时间">-->
<!--            <template slot-scope="scope">-->
<!--              <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('updateUserName')" prop="updateUserName" label="修改人" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('updateTime')" prop="updateTime" label="修改时间">-->
<!--            <template slot-scope="scope">-->
<!--              <span>{{ parseTime(scope.row.updateTime) }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('auditUserName')" prop="auditUserName" label="审核人" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('auditTime')" prop="auditTime" label="审核时间">-->
<!--            <template slot-scope="scope">-->
<!--              <span>{{ parseTime(scope.row.auditTime) }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('closeUserName')" prop="closeUserName" label="关闭人" />-->
<!--          <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('closeTime')" prop="closeTime" label="关闭时间">-->
<!--            <template slot-scope="scope">-->
<!--              <span>{{ parseTime(scope.row.closeTime) }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--        </div>-->
<!--        <el-table-column :render-header="crud.renderHeader" v-permission="['admin','logisticsLoad:edit','logisticsLoad:del']" label="操作" width="150px" align="right">-->
<!--          <template slot-scope="scope">-->
<!--            <udOperation-->
<!--              :data="scope.row"-->
<!--              :permission="permission"-->
<!--            />-->
<!--          </template>-->
<!--        </el-table-column>-->
      </el-table>
      <vue-context-menu :contextMenuData="contextMenuData"
                        @tableConfig="tableConfig"
                        @deletedata="deletedata"></vue-context-menu>
      <!--分页组件-->
      <pagination />
      <el-dialog  title="打印预览"
                  destroy-on-close
                  v-dialogDrag
                  close-on-press-escape
                  :visible.sync="showPdf" append-to-body width="50vw">
        <j-pdf :src="pdfSrc" ></j-pdf>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import crudLogisticsLoad from '@/api/erp/logisticsLoad'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import jPrintConfig from "../../../components/jPrintConfig/jPrintConfig";
import elementResizeDetectorMaker from "element-resize-detector"
import add from '@/api/erp/headerProperties'
import Sortable from 'sortablejs'
import jTableColumnConfig from "@/components/jTableColumnConfig/jTableColumnConfig";
import {tablemixins} from "@/mixins/tablemixins";
import {getLogisticsLoadPreviousNextPageIdList} from "../../../api/erp/logisticsLoad";
import VTreeSelect from '@/components/VTreeSelect'


// crud交由presenter持有
const defaultCrud = CRUD({ title: '配送单',name:'LogisticsLoad', url: 'api/logisticsLoad', sort: 'busDate,desc',optShow: {
    add: false,
    edit: false,
    del: true,
    download: false,
    leadingIn: false,
    enable: false,
    disable: false,
    pass: true,
    reject: true,
    printDetail:true,
    print: true,
  },
  crudMethod: { ...crudLogisticsLoad }})
const defaultForm = { id: null, code: null, name: null, type: null, busDate: null, carId: null, carCode: null, carName: null, driverUserId: null, driverUserCode: null, driverUserName: null, followUserId: null, followUserIds: null, followUserCode: null, followUserName: null, deptId: null, deptCode: null, deptName: null, userId: null, userCode: null, userName: null, orderNum: null, customerNum: null, goodsNum: null, boxCount: null, taxAmount: null, noTaxAmount: null, tax: null, receiveAmount: null, isAccept: null, acceptDate: null, acceptUserId: null, acceptUserCode: null, acceptUserName: null, acceptBoxCount: null, acceptTaxAmount: null, acceptNoTaxAmount: null, acceptTax: null, isReturnBox: null, returnBoxDate: null, returnBoxUserId: null, returnBoxUserCode: null, returnBoxUserName: null, returnBoxBoxCount: null, returnBoxTaxAmount: null, returnBoxNoTaxAmount: null, returnBoxTax: null, volume: null, weight: null, isReceipt: null, isPrint: null, printCount: null, seq: null, orderStatus: null, verifyCode: null, remark: null, orderRemark: null, createUserId: null, createUserCode: null, createUserName: null, createTime: null, updateUserId: null, updateUserCode: null, updateUserName: null, updateTime: null, auditUserId: null, auditUserCode: null, auditUserName: null, auditTime: null, closeUserId: null, closeUserCode: null, closeUserName: null, closeTime: null }


export default {
  name: 'LogisticsLoad',
  components: { pagination, crudOperation, rrOperation, udOperation, jPrintConfig, jTableColumnConfig, VTreeSelect },
  mixins: [presenter(defaultCrud), header(), form(defaultForm), crud(),tablemixins],
  dicts: ['common_order_status','common_yes_or_no','t_logistics_load_customer_debt_status'],
  data() {
    return {
      multiple: true,
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          }
        }]
      },
      permission: {
        add: ['admin', 'logisticsLoad:add'],
        edit: ['admin', 'logisticsLoad:edit'],
        del: ['admin', 'logisticsLoad:del'],
        import: ['admin', 'logisticsLoad:import'],
        export: ['admin', 'logisticsLoad:export'],
        copy: ['admin', 'logisticsLoad:copy'],
        upload: ['admin', 'logisticsLoad:upload'],
        download: ['admin', 'logisticsLoad:download'],
        pass: ['admin', 'logisticsLoad:pass'],
        reject: ['admin', 'logisticsLoad:reject'],
        closed: ['admin', 'logisticsLoad:closed'],
        invalid: ['admin', 'logisticsLoad:invalid'],
        stop: ['admin', 'logisticsLoad:stop'],
        recover: ['admin', 'logisticsLoad:recover'],
        print: ['admin', 'logisticsLoad:print'],
        salesOrderPrint: ['admin', 'logisticsLoad:salesOrderPrint'],
        goodsPrint: ['admin', 'logisticsLoad:goodsPrint'],
        follow: ['admin', 'logisticsLoad:follow'],
        accept: ['admin', 'logisticsLoad:accept'],
        appendOrder: ['admin', 'logisticsLoad:appendOrder'],
        returnBox: ['admin', 'logisticsLoad:returnBox'],
        unReturnBox: ['admin', 'logisticsLoad:unReturnBox'],
        removeCustomer: ['admin', 'logisticsLoad:removeCustomer'],
        removeOrder: ['admin', 'logisticsLoad:removeOrder'],
        removeReturnBoxOrder: ['admin', 'logisticsLoad:removeReturnBoxOrder'],
        customerReceipt: ['admin', 'logisticsLoad:customerReceipt'],
        batchCustomerReceipt: ['admin', 'logisticsLoad:batchCustomerReceipt'],
        returnBoxPass: ['admin', 'logisticsLoad:returnBoxPass'],
        returnBoxReject: ['admin', 'logisticsLoad:returnBoxReject'],
      },
      showPdf:false,
      pdfSrc:'',
      rules: {
      },
    }
  },
  watch: {
  },

    updated() {
      this.$nextTick(() => {
        this.$refs.table.doLayout()
      })},
  methods: {
    setQuery(id){
      const idDate = Date.now().toString()
      getLogisticsLoadPreviousNextPageIdList({...this.query,id,...this.crud.page,sort:this.query.sort || this.crud.sort}).then(res=>{
        sessionStorage.setItem(idDate,JSON.stringify(res.data))
      })
      console.log(`logisticsLoadDetail/${id}?idDate=${idDate}`)
      this.$router.push({ path:`logisticsLoadDetail/${id}?idDate=${idDate}`})
    },
    getValue(e) {
      this.query.startTime = this.query.dataExtent[0]
      this.query.endTime = this.query.dataExtent[1]
    },
    // 获取数据前设置好接口地址
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }, // 新增与编辑前做的操作
    [CRUD.HOOK.afterToCU](crud, form) {
    },
  }
}
</script>

<style scoped>
  .table-img {
    display: inline-block;
    text-align: center;
    background: #ccc;
    color: #fff;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
    width: 32px;
    height: 32px;
    line-height: 32px;
  }
</style>
